package org.douxiaoban.client.api;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: huangzhongkun
 * Date: 11-6-25
 * Time: 下午9:45
 */
public class TestParcelable implements Parcelable{
  private  String  name  ;
	private  String  surName ;
	private  int     age ;
    public ArrayList<String> tags;

    public ArrayList<String> getTags() {
        return tags;
    }

    public void setTags(ArrayList<String> tags) {
        this.tags = tags;
    }

    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurName() {
		return surName;
	}

	public void setSurName(String surName) {
		this.surName = surName;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Override
	public int describeContents() {

		// TODO Auto-generated method stub
		return 0;

	}

	@Override
	public void writeToParcel(Parcel dest, int flag) {

		// TODO Auto-generated method stub

		dest.writeInt(age);
		dest.writeString(name);
		dest.writeString(surName);
        dest.writeList(tags);

	}
	public static final Parcelable.Creator CREATOR = new Creator() {

		@Override
		public TestParcelable createFromParcel(Parcel source) {

			// TODO Auto-generated method stub
			TestParcelable parcelableObj = new TestParcelable();
			parcelableObj.age=source.readInt();
			parcelableObj.surName=source.readString();
			parcelableObj.name = source.readString();
            parcelableObj.tags = source.readArrayList(null) ;
			return parcelableObj;

		}

		@Override
		public TestParcelable[] newArray(int size) {

			// TODO Auto-generated method stub
			return new TestParcelable[size];

		}

	};
}
